package com.huike.web.controller.report;


import com.huike.clues.domain.vo.IndexStatisticsVo;
import com.huike.common.core.domain.AjaxResult;
import com.huike.report.service.IReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IReportService reportService;

    @GetMapping
    public AjaxResult index(IndexStatisticsVo vo) {

        return AjaxResult.success(reportService.getIndexVo(vo));
    }

    @GetMapping("/businessChangeStatistics")
    public AjaxResult businessChangeStatistics(IndexStatisticsVo vo){
        return AjaxResult.success(reportService.salesStatisticsForIndex(vo));
    }

    @GetMapping("/salesStatistic")
    public AjaxResult salesStatistic(IndexStatisticsVo vo){
       return AjaxResult.success(reportService.getSalesStatistic(vo));
    }
}
